
public class Rectangle extends Figure {

	private double length;
	private double width;
	
	//constructor
	public Rectangle(double aLength, double aWidth){
		super(aLength, aWidth);
		length=aLength;
		width=aWidth;
	}
	
	//accessors
	public double getLength(){
		return length;
	}
	public double getWidth(){
		return width;
	}
	
	//mutators
	public void setLength(double aLength){
		length=aLength;
	}
	public void setWidth(double aWidth){
		width=aWidth;
	}

	
	public void updateArea() {
		double area;
		area=width*length;
		setArea(area);
	}
	public void updatePerimeter(){
		double perimeter;
		perimeter=(2*width)+(2*length);
		setPerimeter(perimeter);
	}
}
